//package com.yawn.zdweb.config.session;
//
//import feign.Request;
//import feign.RequestInterceptor;
//import feign.RequestTemplate;
//import org.springframework.stereotype.Component;
//import org.springframework.web.servlet.HandlerInterceptor;
//import org.springframework.web.servlet.ModelAndView;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import javax.servlet.http.HttpSession;
//
//@Component
//public class HeaderInterceptor implements RequestInterceptor, HandlerInterceptor {
//
//    private HttpSession session;
//
//    @Override
//    public void apply(RequestTemplate requestTemplate) {
//        requestTemplate.header("cookies", "JSESSIONID=12345566778990");
//        Request request = requestTemplate.request();
//        System.out.println(request.url());
//        request.headers().forEach((key, value) -> {
//            System.out.println(key);
//            value.forEach(System.out::println);
//        });
//    }
//
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object o) throws Exception {
//        session = request.getSession();
//        return true;
//    }
//
//    @Override
//    public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {
//
//    }
//
//    @Override
//    public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception {
//
//    }
//}
